package com.zsinfo.guoss.supplier.activity;

import android.view.View;
import android.widget.TextView;

import com.example.netcenter.Event.Response;
import com.example.netcenter.RetrofitBuilder;
import com.example.netcenter.Url.ConstantsCode;
import com.example.netcenter.bean.DescBean;
import com.example.netcenter.bean.ResultsData;
import com.zsinfo.guoss.supplier.R;
import com.zsinfo.guoss.supplier.base.BaseActivity;
import com.zsinfo.guoss.supplier.utils.SharedPreferencesUtil;

import butterknife.BindView;

/**
 * Created by lixl on 2018/12/4.
 * <p>
 * desc:合作协议
 */
public class AgreementActivity extends BaseActivity {

    @BindView(R.id.tv_desc)
    TextView tv_desc;

    @Override
    protected int getContentLayoutRes() {
        return R.layout.activity_agreement;
    }

    @Override
    protected void initView() {
        setTitle("合作协议");
        setBackAndLeftTitle("返回").setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    protected void initNetData() {
        GetNetCenter().GetNetCenter(this, RetrofitBuilder.CreateApi().SUPPLIER_TERMS(ConstantsCode.gss_desc, SharedPreferencesUtil.getWebsiteNode()+"#JKBZJ-DESC"), new Response() {
            @Override
            public void OK(Object data) {
                ResultsData<DescBean> resultsData = (ResultsData<DescBean>) data;
                DescBean descBean = resultsData.getData();
                tv_desc.setText(descBean.getDesc());
            }

            @Override
            public void Fail(Throwable e) {

            }

            @Override
            public void complete() {

            }
        });
    }

    @Override
    protected void customDestroy() {

    }
}
